package beans.lifecycle;

import cn.stimd.spring.beans.factory.DisposableBean;

import javax.annotation.PreDestroy;

/**
 * Created by Stimd
 * 项目地址：https://gitee.com/stimd/spring-wheel
 * 公众号：Java编程探微
 */
public class MyDestroyBean implements DisposableBean {

    @PreDestroy
    private void close(){
        System.out.println("销毁 @PreDestroy 注解方法...");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("销毁 DisposableBean 接口方法...");
    }

    public void customDestroy(){
        System.out.println("销毁自定义 destroy 方法...");
    }
}
